<?php

/**
 * KTDArtefact form.
 *
 * @package    s-test
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class KTDArtefactForm extends BaseKTDArtefactForm
{
  public function configure()
  {
  }
}

class BackendKTDArtefactForm extends BaseKTDArtefactForm{
    public function configure(){
        $this->setWidget("description", new sfWidgetFormTextarea());
        $this->setWidget("icon", new sfWidgetFormInputFileEditable(array(
               'label' => 'Icône de l\'artefact',
               'is_image' => true,
               'file_src' => '/uploads/images/artefacts/icon/'.$this->getObject()->getIcon(),
               'edit_mode'=> !$this->isNew(),
               'template'  => '%file%<br />%input%<br/>%delete% %delete_label%')));

       $this->validatorSchema['icon'] = new sfValidatorFile(array(
        'required'   => false,
        'path'       => sfConfig::get('sf_upload_dir').'/images/artefacts/icon',
        'mime_types' => 'web_images',
       ));
       $this->validatorSchema['icon_delete'] = new sfValidatorPass();
    }
}